<template>
  <div>
    <nut-navbar
      @on-click-back="$router.back()"
      title="领券中心"
    >
    </nut-navbar>
    <div class="content">
      <div :class='{active:arr.some(e => {
        return e == 1
      })}'>
        <div class="coupon_card">
          <div class="left">
            <h3>OMINI.BASS官方旗舰店</h3>
            <p>有效期：2022.07.01 - 2022.11.11</p>
          </div>
          <div
            class="right"
            @click="receive(1)"
          >
            <div class="right_content">
              <div class="num">
                <span>¥</span>
                <h3>20</h3>
              </div>
              <h3>立即领取</h3>
              <img
                src="../assets/images/hongbao.png"
                alt=""
              >
            </div>
          </div>

        </div>
      </div>
      <div :class='{active:arr.some(e => {
        return e == 2
      })}'>
        <div class="coupon_card">
          <div class="left">
            <h3>OMINI.BASS官方旗舰店</h3>
            <p>有效期：2022.07.01 - 2022.11.11</p>
          </div>
          <div
            class="right"
            @click="receive(2)"
          >
            <div class="right_content">
              <div class="num">
                <span>¥</span>
                <h3>20</h3>
              </div>
              <h3>立即领取</h3>
              <img
                src="../assets/images/hongbao.png"
                alt=""
              >
            </div>
          </div>

        </div>
      </div>
      <div :class='{active:arr.some(e => {
        return e == 3
      })}'>
        <div class="coupon_card">
          <div class="left">
            <h3>OMINI.BASS官方旗舰店</h3>
            <p>有效期：2022.07.01 - 2022.11.11</p>
          </div>
          <div
            class="right"
            @click="receive(3)"
          >
            <div class="right_content">
              <div class="num">
                <span>¥</span>
                <h3>20</h3>
              </div>
              <h3>立即领取</h3>
              <img
                src="../assets/images/hongbao.png"
                alt=""
              >
            </div>
          </div>

        </div>
      </div>
      <div :class='{active:arr.some(e => {
        return e == 4
      })}'>
        <div class="coupon_card">
          <div class="left">
            <h3>OMINI.BASS官方旗舰店</h3>
            <p>有效期：2022.07.01 - 2022.11.11</p>
          </div>
          <div
            class="right"
            @click="receive(4)"
          >
            <div class="right_content">
              <div class="num">
                <span>¥</span>
                <h3>20</h3>
              </div>
              <h3>立即领取</h3>
              <img
                src="../assets/images/hongbao.png"
                alt=""
              >
            </div>
          </div>

        </div>
      </div>
      <div :class='{active:arr.some(e => {
        return e == 5
      })}'>
        <div class="coupon_card">
          <div class="left">
            <h3>OMINI.BASS官方旗舰店</h3>
            <p>有效期：2022.07.01 - 2022.11.11</p>
          </div>
          <div
            class="right"
            @click="receive(5)"
          >
            <div class="right_content">
              <div class="num">
                <span>¥</span>
                <h3>20</h3>
              </div>
              <h3>立即领取</h3>
              <img
                src="../assets/images/hongbao.png"
                alt=""
              >
            </div>
          </div>

        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      arr: []
    }
  },
  methods: {


    receive (num) {
      this.arr.push(num)
      this.arr.every(e => {
        return e == num
      })
    }
  },
}
</script>

<style lang="scss" scoped>
.nut-navbar {
  background-color: #eae9e5;
}
.content {
  width: 100vw;
  padding: 0 20px 0;
  box-sizing: border-box;
  .coupon_card {
    width: 90vw;
    margin: 0 auto 20px;
    background-color: #f7f7f7;
    display: flex;
    justify-content: space-between;
    // align-items: center;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    .left {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      box-sizing: border-box;
      padding: 20px 0 20px 20px;
      background-color: #f7f7f7;
      h3 {
        font-weight: 700;
        color: #333333;
        font-size: 14px;
        text-align: left;
      }
      p {
        font-weight: 400;
        font-size: 12px;
        color: #999999;
        text-align: left;
      }
    }
    .right {
      width: 96px;
      overflow: hidden;
      height: 100px;
      box-sizing: border-box;
      .right_content {
        width: 100px;
        height: 100px;
        padding: 10px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: flex-end;
        position: relative;
        background-color: #c1ab96;
        border-left: 2px dashed #fff;
        border-right: 9px dotted #f7f7f7;
        .num {
          display: flex;
          align-items: baseline;
          text-align: right;
          span {
            font-weight: 400;
            font-size: 13px;
            color: #ffffff;
          }
          h3 {
            font-weight: 400;
            font-size: 24px;
            color: #ffffff;
          }
        }
        h3 {
          font-weight: 400;
          font-size: 12px;
          color: #ffffff;
          text-align: right;
        }
        img {
          width: 35px;
          height: 40px;
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
          left: 10%;
        }
      }
    }
  }
  .active {
    height: 30px;
    z-index: -999;
    // box-sizing: border-box;
    // overflow: hidden;
    .coupon_card {
      .right {
        .right_content {
          background-color: #999999;
        }
      }
    }
  }
}
</style>